package top.aicey.ai.sparring.common.exception;

import lombok.Data;
import top.aicey.ai.sparring.common.holder.RequestHeaderHolder;
import top.aicey.ai.sparring.dto.model.ErrorContext;

@Data
public class BaseException  extends RuntimeException {
    private String requestId = RequestHeaderHolder.getRequestHeader().getRequestId();
    private ErrorContext error;
    private Object data;

    protected BaseException(ErrorContext errorContext, Object data) {
        super(errorContext.getMessage());
        this.data = data;
        this.error = errorContext;
    }

}
